    <?php include 'header.php';

        $class_id = empty($_GET['class_id'])?'index':$_GET['class_id'];
    ?>



		<div class="content1">
			<div class="w100">
				<a href="index.php" class="btn5 <?php if($class_id == 'index'){echo 'on';}?>">全部</a>
                <?php foreach (select("SELECT * FROM class",'all') as $k=>$v){?>
				<a href="index.php?class_id=<?php echo $v['id']?>" class="btn5 <?php if($class_id == $v['id']){echo 'on';}?>"><?php echo $v['name']?></a>
                <?php }?>
			</div>

			<div class="box3">

                <?php
                if($class_id == 'index'){
                    $sql = "SELECT * FROM goods ";
                }else{
                    $sql = "SELECT * FROM goods where class_id = ".$class_id;
                }
                foreach (select($sql,'all') as $k=>$v){
                    ?>
				<a href="man.php?id=<?php echo $v['id']?>" class="list1">
					<img src="<?php echo $v['image']?>" class="img1" >
					<div class="line2 txt4"><?php echo $v['name']?></div>
					<span  class="line1 txt5">￥<?php echo $v['price']?></span>
				</a>
                <?php }?>


			</div>


		</div>


		<div class="foot">

		</div>
	</body>
</html>
